package com.zd.service.lmpl;/**
 * @Description: TransportProtocolServicelmpl
 * @Author:pioneer
 * @Date: 2021-07-02
 * @Version:v1.0
 */

import com.zd.mapper.TransportProtocolMapper;
import com.zd.service.lnter.TransportProtocolServicelnter;
import com.zzg.entity.Transportprotocol;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Description: TransportProtocolServicelmpl
 * @Author:pioneer
 * @Date: 2021-07-02
 * @Version:v1.0
 */
@Service
public class TransportProtocolServicelmpl implements TransportProtocolServicelnter {

    @Autowired
    private TransportProtocolMapper transportProtocolMapper;
    /**
     * 根据货运单号删除运单
     *
     * @param freightinformation 货物单号
     * @return 返回数值判断是否删除成功
     */
    @Override
    public int delectagreement(String freightinformation) {
        System.out.println ("freightinformation=="+freightinformation);
        return transportProtocolMapper.delectagreement (freightinformation);
    }

    /**
     * 根据运输协议id修改相关信息
     *
     * @param departuretime 发车时间
     * @param shipping      运输单号
     * @return 返回数值判断是否修改成功
     */
    @Override
    public int updateargee(String departuretime, String shipping) {
        return transportProtocolMapper.updateargee (departuretime,shipping);
    }

    /**
     * 根据运单id查询运输协议详情
     * @param consigneeid 运输单号
     * @return 运输协议对象
     */
    @Override
    public Transportprotocol selectagreeByid(String consigneeid) {
        return transportProtocolMapper.selectagreeByid (consigneeid);
    }

    /**
     * 根据运单管理id删除运输信息
     * @param consigneeid 运输单号
     * @return 返回数值判断是否删除成功
     */
    @Override
    public int delectagreeByid(String consigneeid) {
        return transportProtocolMapper.delectagreeByid (consigneeid);
    }

    /**
     * 通过运单id修改运输信息
     * @param departureTime 发车时间
     * @param trackingNumbe 运输单号
     * @param waybillid     运单id
     * @return 返回数值判断是否修改成功
     */
    @Override
    public int updateTransportProtocol(String departureTime, String trackingNumbe, String waybillid) {
        return transportProtocolMapper.updateTransportProtocol (departureTime,trackingNumbe,waybillid);
    }


}
